# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Roberto Oliveira <robertoguimaraes8@gmail.com>
pkgname=popl
pkgver=1.2.0
pkgrel=1
pkgdesc="Header-only C++ program options parser library"
url="https://github.com/badaix/popl"
arch="noarch"
license="MIT"
makedepends="cmake"
options="!check" # no tests
source="popl-$pkgver.tar.gz::https://github.com/badaix/popl/archive/v$pkgver.tar.gz"
builddir="$srcdir/popl-$pkgver"

build() {
	cd "$builddir"
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		${CMAKE_CROSSOPTS}
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

sha512sums="a5d372346dd282f634b1ca92f468588f7069b34a5911a6ea46e5ef33e8e6c360ca13f67bf221555d76c7620c4222694077a74589a1c32bdbc094e64366299609  popl-1.2.0.tar.gz"
